﻿Public Class frm_Listado_Notas
    Dim _acceso As AccesoBD

    Private Sub frm_Listado_Notas_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
        Me.Dispose()
    End Sub
    Private Sub frm_Listado_Notas_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Me.ReportViewer1.RefreshReport()
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        cargarReporte()
    End Sub
    Private Sub cargarReporte()
        Dim consulta As String
        consulta = "select d.idCurso, d.fechaInicioCurso, d.fechaExamen, (a.apellido+ ','+a,nombre) as alumno"
        consulta &= " d.nota, t.nombre as nombreCurso"
        consulta &= " from DetalleExamenes d, Cursos c, TipoCurso t, Alumnos a"
        'consulta &= " where d.idCurso like" 
        Dim tabla = _acceso.devuelveTabla(consulta)
        DS_Notas.DataSource = tabla
        If tabla.Rows.Count = 0 Then
            MsgBox("No existen notas cargadas para este exámen")
            Exit Sub
        Else
            ReportViewer1.RefreshReport()
        End If

    End Sub
End Class